﻿

//$(document).ready(function () {

//    ("#validate_wizard").submit(function () {
//        alert("The paragraph was clicked.");
//    });

//});
//
function kiemtra() {
    var text = document.getElementById("TieuDeBaiViet").value;
    var textmota = document.getElementById("mota").value;
    var textnoidung = document.getElementById("noidung").value;
    if (text == "") {
        doimauloi(document.getElementById("TieuDeBaiViet"));
        return false;
    }
    else if (textmota == "") {
        doimauloi(document.getElementById("mota"));
        return false;
    }
    else if (textnoidung == "") {
        doimauloi(document.getElementById("noidung"));
        return false;
    }
}
function doimauloi(id) {
    id.style.backgroundColor = '#FC0820';
}
//
function changetextmenu() {
    var select = document.getElementById("cboMenu");
    var textboxMenu = document.getElementById("menu");
    textboxMenu.value = select.value;
}

// load hinh bang javascript
function file_change(f) {

    var reader = new FileReader();

    reader.onload = function (e) {

        var img = document.getElementById("img");

        img.src = e.target.result;

        img.style.display = "inline";

    };

    reader.readAsDataURL(f.files[0]);

}
function demkytu(id, count, max) 
{var field = document.getElementById(id);
    var span= document.getElementById(count);
    if (field.value.length > max)
        field.value = field.value.substring(0, max);
    else
        thaydoikytuspan(max - field.value.length, span);
      //  count.value = max - field.value.length;
}
function thaydoikytuspan(value, field) {
    var text = document.createTextNode(value);
    field.firstChild.nodeValue = value;

}
// kiem tra du lieu nhaps
function kiemtrataobaiviet(kiemtra, sokytu, tinnhan) {
    if (kiemtra.value.length > sokytu) {
        alert(tinnhan);
        kiemtra.style.backgroundColor = '#FC0820';
        document.getElementById("myButton1").disabled = true;
        return false;
    }
    else {
        kiemtra.style.backgroundColor = '#FFFFFF';
    }
}
// xet background
function xetmaunen(kiemtra) {
   
     
        kiemtra.style.backgroundColor = '#FFFFFF';
   
}
//
function loadCheckKiemTraTaiKhoanAdmin() {
    var option = document.getElementById("nhom").value;

    $('#checkNhom').load("?idNhom=" + option);

}
